#ifndef _ROS_robik_GenericStatus_h
#define _ROS_robik_GenericStatus_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
#include "std_msgs/Header.h"

namespace robik
{

  class GenericStatus : public ros::Msg
  {
    public:
      std_msgs::Header header;
      bool bumper_front;
      bool motion_detector;
      int32_t odom_ticksLeft;
      int32_t odom_ticksRight;
      uint32_t odom_millisSinceLastUpdate;
      float ultrasound_Back;
      int32_t arm_yaw;
      int32_t arm_shoulder;
      int32_t arm_elbow;
      int32_t arm_roll;
      int32_t arm_clamp;
      bool arm_fore_clamp;
      bool arm_back_clamp;

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      offset += this->header.serialize(outbuffer + offset);
      union {
        bool real;
        uint8_t base;
      } u_bumper_front;
      u_bumper_front.real = this->bumper_front;
      *(outbuffer + offset + 0) = (u_bumper_front.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->bumper_front);
      union {
        bool real;
        uint8_t base;
      } u_motion_detector;
      u_motion_detector.real = this->motion_detector;
      *(outbuffer + offset + 0) = (u_motion_detector.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->motion_detector);
      union {
        int32_t real;
        uint32_t base;
      } u_odom_ticksLeft;
      u_odom_ticksLeft.real = this->odom_ticksLeft;
      *(outbuffer + offset + 0) = (u_odom_ticksLeft.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_odom_ticksLeft.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_odom_ticksLeft.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_odom_ticksLeft.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->odom_ticksLeft);
      union {
        int32_t real;
        uint32_t base;
      } u_odom_ticksRight;
      u_odom_ticksRight.real = this->odom_ticksRight;
      *(outbuffer + offset + 0) = (u_odom_ticksRight.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_odom_ticksRight.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_odom_ticksRight.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_odom_ticksRight.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->odom_ticksRight);
      *(outbuffer + offset + 0) = (this->odom_millisSinceLastUpdate >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->odom_millisSinceLastUpdate >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->odom_millisSinceLastUpdate >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->odom_millisSinceLastUpdate >> (8 * 3)) & 0xFF;
      offset += sizeof(this->odom_millisSinceLastUpdate);
      union {
        float real;
        uint32_t base;
      } u_ultrasound_Back;
      u_ultrasound_Back.real = this->ultrasound_Back;
      *(outbuffer + offset + 0) = (u_ultrasound_Back.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_ultrasound_Back.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_ultrasound_Back.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_ultrasound_Back.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->ultrasound_Back);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_yaw;
      u_arm_yaw.real = this->arm_yaw;
      *(outbuffer + offset + 0) = (u_arm_yaw.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_arm_yaw.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_arm_yaw.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_arm_yaw.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_yaw);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_shoulder;
      u_arm_shoulder.real = this->arm_shoulder;
      *(outbuffer + offset + 0) = (u_arm_shoulder.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_arm_shoulder.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_arm_shoulder.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_arm_shoulder.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_shoulder);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_elbow;
      u_arm_elbow.real = this->arm_elbow;
      *(outbuffer + offset + 0) = (u_arm_elbow.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_arm_elbow.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_arm_elbow.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_arm_elbow.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_elbow);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_roll;
      u_arm_roll.real = this->arm_roll;
      *(outbuffer + offset + 0) = (u_arm_roll.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_arm_roll.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_arm_roll.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_arm_roll.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_roll);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_clamp;
      u_arm_clamp.real = this->arm_clamp;
      *(outbuffer + offset + 0) = (u_arm_clamp.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_arm_clamp.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_arm_clamp.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_arm_clamp.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_clamp);
      union {
        bool real;
        uint8_t base;
      } u_arm_fore_clamp;
      u_arm_fore_clamp.real = this->arm_fore_clamp;
      *(outbuffer + offset + 0) = (u_arm_fore_clamp.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->arm_fore_clamp);
      union {
        bool real;
        uint8_t base;
      } u_arm_back_clamp;
      u_arm_back_clamp.real = this->arm_back_clamp;
      *(outbuffer + offset + 0) = (u_arm_back_clamp.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->arm_back_clamp);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      offset += this->header.deserialize(inbuffer + offset);
      union {
        bool real;
        uint8_t base;
      } u_bumper_front;
      u_bumper_front.base = 0;
      u_bumper_front.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->bumper_front = u_bumper_front.real;
      offset += sizeof(this->bumper_front);
      union {
        bool real;
        uint8_t base;
      } u_motion_detector;
      u_motion_detector.base = 0;
      u_motion_detector.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->motion_detector = u_motion_detector.real;
      offset += sizeof(this->motion_detector);
      union {
        int32_t real;
        uint32_t base;
      } u_odom_ticksLeft;
      u_odom_ticksLeft.base = 0;
      u_odom_ticksLeft.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_odom_ticksLeft.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_odom_ticksLeft.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_odom_ticksLeft.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->odom_ticksLeft = u_odom_ticksLeft.real;
      offset += sizeof(this->odom_ticksLeft);
      union {
        int32_t real;
        uint32_t base;
      } u_odom_ticksRight;
      u_odom_ticksRight.base = 0;
      u_odom_ticksRight.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_odom_ticksRight.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_odom_ticksRight.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_odom_ticksRight.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->odom_ticksRight = u_odom_ticksRight.real;
      offset += sizeof(this->odom_ticksRight);
      this->odom_millisSinceLastUpdate =  ((uint32_t) (*(inbuffer + offset)));
      this->odom_millisSinceLastUpdate |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->odom_millisSinceLastUpdate |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->odom_millisSinceLastUpdate |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->odom_millisSinceLastUpdate);
      union {
        float real;
        uint32_t base;
      } u_ultrasound_Back;
      u_ultrasound_Back.base = 0;
      u_ultrasound_Back.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_ultrasound_Back.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_ultrasound_Back.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_ultrasound_Back.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->ultrasound_Back = u_ultrasound_Back.real;
      offset += sizeof(this->ultrasound_Back);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_yaw;
      u_arm_yaw.base = 0;
      u_arm_yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_arm_yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_arm_yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_arm_yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->arm_yaw = u_arm_yaw.real;
      offset += sizeof(this->arm_yaw);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_shoulder;
      u_arm_shoulder.base = 0;
      u_arm_shoulder.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_arm_shoulder.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_arm_shoulder.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_arm_shoulder.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->arm_shoulder = u_arm_shoulder.real;
      offset += sizeof(this->arm_shoulder);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_elbow;
      u_arm_elbow.base = 0;
      u_arm_elbow.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_arm_elbow.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_arm_elbow.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_arm_elbow.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->arm_elbow = u_arm_elbow.real;
      offset += sizeof(this->arm_elbow);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_roll;
      u_arm_roll.base = 0;
      u_arm_roll.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_arm_roll.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_arm_roll.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_arm_roll.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->arm_roll = u_arm_roll.real;
      offset += sizeof(this->arm_roll);
      union {
        int32_t real;
        uint32_t base;
      } u_arm_clamp;
      u_arm_clamp.base = 0;
      u_arm_clamp.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_arm_clamp.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_arm_clamp.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_arm_clamp.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->arm_clamp = u_arm_clamp.real;
      offset += sizeof(this->arm_clamp);
      union {
        bool real;
        uint8_t base;
      } u_arm_fore_clamp;
      u_arm_fore_clamp.base = 0;
      u_arm_fore_clamp.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->arm_fore_clamp = u_arm_fore_clamp.real;
      offset += sizeof(this->arm_fore_clamp);
      union {
        bool real;
        uint8_t base;
      } u_arm_back_clamp;
      u_arm_back_clamp.base = 0;
      u_arm_back_clamp.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->arm_back_clamp = u_arm_back_clamp.real;
      offset += sizeof(this->arm_back_clamp);
     return offset;
    }

    const char * getType(){ return "robik/GenericStatus"; };
    const char * getMD5(){ return "eda427f255fe112362f46c1783ef63d0"; };

  };

}
#endif